package de.tum.beilmeiner.im.shared.model;

import java.util.ArrayList;

import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.FlexTable;
import com.google.gwt.user.client.ui.Label;

public class UserFlexTable extends FlexTable{

	private ArrayList<User> users_in_list = new ArrayList<User>();
	
	public void addUserToTable(User user, Button userBtn ) {
	
		users_in_list.add(user);
		Label userLbl = new Label(user.getName());
		this.setWidget(users_in_list.size(), 0, userLbl);
		this.setWidget(users_in_list.size(), 1, userBtn);
		
	}

	public void removeAllUsers()
	{
	users_in_list.clear();
	this.removeAllRows();
	}

	public User getUserAtRow(int row) {
		return users_in_list.get(row-1);
	}
}
